import request from '@/utils/request'

export function getInfo() {
  return request({
    url: '/user/info',
    method: 'get'
  })
}

export function profile(data) {
  return request({
    url: '/user/profile',
    method: 'post',
    data
  })
}

export function login(data) {
  return request({
    url: '/login',
    method: 'post',
    data
  })
}

export function logout() {
  return request({
    url: '/logout',
    method: 'post'
  })
}

export function setRegistry(data) {
  return request({
    url: '/registry',
    method: 'post',
    data
  })
}

export function updatePassword(data) {
  return request({
    url: '/user/updatePassword',
    method: 'post',
    data
  })
}

export function uploadAvatar(data) {
  return request.formDataPost('/user/uploadAvatar', data)
}

export function getMailCode(data) {
  return request({
    url: '/user/sendEmailCode',
    method: 'post',
    data,
    timeout: 20000
  })
}

export function getWords() {
  return request({
    url: '/user/getSysWords',
    method: 'get'
  })
}

export function uploadSign(data) {
  console.log('data:', data)
  return request.formDataPost('/user/uploadSign', data)
}

export function getUserSign() {
  return request.get('/user/getUserSign')
}

export function getTodayMoney() {
  return request({
    url: '/user/gettodayTransactionSummary',
    method: 'get'
  })
}
export function getData() {
  return request({
    url: '/user/gettodayTransactionSummary',
    method: 'get'
  })
}
export function getDatas() {
  return request({
    url: '/user/getTwoSum',
    method: 'get'
  })
}

// 提现金额
export function withdrawalReview(data) {
  return request({
    url: '/user/withdrawalReview',
    method: 'post',
    data: data
  })
}

// user/verificationBeforeWithdrawal
export function getBalance() {
  return request({
    url: '/user/verificationBeforeWithdrawal',
    method: 'get'
  })
}

//  扣除余额功能
export function goodsPointDeduction(query) {
  return request({
    url: '/user/goodsPointDeduction',
    method: 'get',
    params: query
  })
}

// 获取采购历史订单
export function getAllCgOrderList(query) {
  return request({
    url: '/user/getAllCgOrderList',
    method: 'get',
    params: query
  })
}



// 消费记录   type = 1 消费记录        type = 2 提现记录   
export function getConsumptionRecordQuery(query) {
  return request({
    url: '/user/getConsumptionRecordQuery',
    method: 'get',
    params: query
  })
}



// 获取店长手机号
export function getLeaderPhone() {
  return request({
    url: '/user/getLeaderPhone',
    method: 'get',
  })
}
